<?php

namespace App\Controller\RPC;

use App\Controller\AbstractController;
use App\Service\SingletonTest;
use Yolo\Service\Annotations\RPC;
use Yolo\Service\ApiGateway;

/**
 * IndexController
 * @author lushaoming<lushaoming6@gmail.com>
 * @date 2024/1/27
 */
class IndexController extends AbstractController
{

    #[RPC([
        'validation' => [],
    ])]
    public function testRpc(array $args): array
    {
        // 内部RPC接口只有$args参数，没有$metadata参数，注解也不需要permissions和options

        return [
            'type' =>'rpc',
            'now' => date('Y-m-d H:i:s')
        ];
    }
}